package com.ray.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSONObject;
import com.ray.bean.FileManagerBean;
import com.ray.bean.OrderCustomTagBean;
import com.ray.bean.OrderInfoDetailBean;
import com.ray.bean.OrderInfoTemplateBean;
import com.ray.exception.ServiceException;
import com.ray.mapper.BasicDataMapper;
import com.ray.mapper.DingTalkMapper;
import com.ray.mapper.FileManagerMapper;
import com.ray.mapper.OrderCreateApplyMapper;
import com.ray.mapper.OrderCreateMapper;
import com.ray.util.ArrayUtils;
/**
 * 
 * @author Shensg
 * 2018年1月26日
 */
@Service
public class FileManagerService {
	@Autowired
	FileManagerMapper fileManagerMapper;
	@Autowired
	DingTalkMapper dingTalkMapper;
	/**
	 * 获取文件列表
	 * @param fileManager
	 * @return
	 */
	public List<FileManagerBean> getFileList(FileManagerBean fileManager) {
		// TODO Auto-generated method stub
		return fileManagerMapper.getFileList(fileManager);
	}
	
	/**
	 * 保存文件
	 */
	public int saveFileManager(FileManagerBean fileManager) {
		// TODO Auto-generated method stub
		return fileManagerMapper.saveFileManager(fileManager);
	}
	
	public String getSerialNo(String string) {
		// TODO Auto-generated method stub
		return dingTalkMapper.getApprovalNo(string);
	}

	public int getFileListCount(FileManagerBean fileManager) {
		// TODO Auto-generated method stub
		return fileManagerMapper.getFileListCount(fileManager);
	}

	/**
	 * 通过订单编号和图片类型删除图片
	 * nate 
	 * orderId 订单编号
	 * type 类型 8 工艺结构数
	 * @param map
	 * @return
	 */
	public int deleteImgByOrderIdAndType(Map map) {
		// TODO Auto-generated method stub
		return fileManagerMapper.deleteImgByOrderIdAndType(map);
	}
	
	
}
